﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Streambolics.Data;

namespace Ewma.Data
{
    public class Event : ShareableObject
    {
        private List<Invitation> _Invitations = new List<Invitation> ();

        public DateTime Date
        {
            get;
            set;
        }

        public Location Location
        {
            get;
            set;
        }

        public List<Invitation> Invitations
        {
            get
            {
                return _Invitations;
            }
        }

        public Invitation InvitationFor (Player aPlayer)
        {
            foreach (Invitation i in _Invitations)
            {
                if (i.Guest == aPlayer)
                {
                    return i;
                }
            }
            return new Invitation ()
            {
                Guest = aPlayer,
                InvitationStatus = InvitationStatus.NotInvited
            };
        }
    }
}